var t = require("../../@babel/runtime/helpers/defineProperty"), a = getApp();

Component({
    properties: {
        datas: {
            type: null,
            value: {}
        },
        params: {
            type: null
        },
        activity: {
            type: null
        },
        form_data_id: String,
        modeType: {
            type: String,
            value: "member"
        },
        desThumb: {
            type: Boolean,
            value: !0
        },
        memberBtn: {
            type: Boolean,
            value: !0
        },
        payStatus: {
            type: null
        },
        applyStatus: {
            type: null
        },
        isTag: {
            type: null
        },
        store_id: {
            type: null
        }
    },
    data: {
        click: !1,
        startDate: new Date("1900-01-01"),
        Height: "",
        formList: [],
        showAddress: !1,
        form_id: "",
        shoTime: "",
        types: {
            88: "diyusername",
            99: "diypassword",
            0: "diyinput",
            1: "diytextarea",
            3: "diycheckbox",
            4: "diyradio",
            2: "diyselect",
            7: "diydate",
            9: "diycity",
            5: "diyimage"
        },
        diydata: [],
        setname: "",
        uploadUrl: "upload.uploadPic",
        provinceData: [],
        cityData: [],
        districtData: [],
        pickerValue: [ 0, 0, 0 ],
        selectAddressData: [],
        currentDate: new Date().getTime(),
        showCity1: !1,
        aisTag: "",
        cityselect_columns: 0,
        pullDownShow: !1,
        pullDown: "",
        popUpType: "",
        popUpTitle: "",
        radioShow: !1,
        checkboxShow: !1
    },
    lifetimes: {
        attached: function() {},
        moved: function() {},
        detached: function() {}
    },
    observers: {
        isTag: function(t) {
            this.setData({
                aisTag: t
            });
        }
    },
    attached: function() {},
    ready: function() {
        this.getForm(), this._initAddressInfo();
    },
    methods: {
        dropDownSelect: function(a) {
            var e = this, i = a.detail.value;
            this.setData({
                pullDown: i,
                pullDownShow: !1
            }), this.data.diydata.forEach(function(a, d) {
                "2" == a.data.data_type && e.setData(t({}, "diydata[" + d + "].value", i));
            });
        },
        closePullDownShow: function() {
            this.setData({
                pullDownShow: !1
            });
        },
        closeCheckboxShow: function() {
            this.setData({
                checkboxShow: !1
            });
        },
        closeRadioShowShow: function() {
            this.setData({
                radioShow: !1
            });
        },
        SelectLabel: function(a) {
            var e = this, i = a.currentTarget.dataset.value;
            "checkbox" == this.data.popUpType ? this.data.diydata.forEach(function(a, d) {
                var s = "diydata[".concat(d, "]");
                if ("3" == a.data.data_type) if (a.data.tp_text[i].checked) {
                    var o = a;
                    o.data.tp_text[i].checked = !1, e.setData(t({}, s, o));
                } else {
                    var n = a;
                    n.data.tp_text[i].checked = !0, e.setData(t({}, s, n));
                }
            }) : "radio" == this.data.popUpType && this.data.diydata.forEach(function(a, d) {
                var s = "diydata[".concat(d, "]");
                if ("4" == a.data.data_type) if (a.data.tp_text[i].checked) ; else {
                    var o = a;
                    o.data.tp_text[i].checked = !0, e.setData(t({}, s, o)), o.data.tp_text.forEach(function(a, s) {
                        if (s != i) {
                            var o = a;
                            o.checked = !1;
                            var n = "diydata[".concat(d, "].data.tp_text[").concat(s, "]");
                            e.setData(t({}, n, o));
                        }
                    });
                }
            });
        },
        radioAssignment: function() {
            var a = this;
            this.data.diydata.forEach(function(e, i) {
                "4" == e.data.data_type && e.data.tp_text.forEach(function(d, s) {
                    if (1 == d.checked) {
                        var o = e, n = "diydata[".concat(i, "]");
                        o.value = d.value, a.setData(t({}, n, o));
                    }
                });
            }), this.closeRadioShowShow();
        },
        checkboxAssignment: function() {
            var a = this, e = [];
            this.data.diydata.forEach(function(i, d) {
                "3" == i.data.data_type && i.data.tp_text.forEach(function(s, o) {
                    if (1 == s.checked) {
                        e.push(s.value);
                        var n = i;
                        n.value = e;
                        var r = "diydata[".concat(d, "]");
                        a.setData(t({}, r, n));
                    }
                });
            }), this.closeCheckboxShow();
        },
        addSelectedState: function() {
            var a = this;
            for (var e in this.data.diydata) "4" != this.data.diydata[e].data.data_type && "3" != this.data.diydata[e].data.data_type || this.data.diydata[e].data.tp_text.forEach(function(i, d) {
                var s = {};
                s.value = i, s.checked = !1;
                var o = "diydata[".concat(e, "].data.tp_text[").concat(d, "]");
                a.setData(t({}, o, s));
            });
        },
        stateChanges: function(t) {
            var a = t.currentTarget.dataset.value;
            "pullDown" == a ? this.setData({
                popUpType: a,
                popUpTitle: "下拉框",
                pullDownShow: !0
            }) : "radio" == a ? this.setData({
                popUpType: a,
                popUpTitle: "单选按钮",
                radioShow: !0
            }) : "checkbox" == a && this.setData({
                popUpType: a,
                popUpTitle: "多选按钮",
                checkboxShow: !0
            });
        },
        scan: function() {
            var t = [];
            this.data.description.replace(/}*src=[\'"]([^\'"]+)[^>]*>/gi, function(a, e) {
                t.push(e);
            }), wx.previewImage({
                urls: t
            });
        },
        getForm: function() {
            var t = this, e = "";
            "flight" != t.data.params ? ("member" == t.data.modeType ? (e = a.getNetAddresss("plugin.diyform.api.diy-form.getDiyFormTypeMemberData"), 
            e += "&form_id=" + this.data.datas) : (e = a.getNetAddresss("plugin.diyform.api.diy-form.getSingleFormData"), 
            this.data.datas.diyform_data_id && (e += "&form_data_id=" + this.data.datas.diyform_data_id), 
            this.data.form_data_id && (e += "&form_data_id=" + this.data.form_data_id), e += "&form_id=" + this.data.datas.form_id), 
            a._postNetWork({
                url: e,
                data: {
                    not_validate_page: "0"
                },
                success: function(e) {
                    var i = e.data;
                    if (console.log(i.data, "12211"), 1 == i.result) if (a._isTextEmpty(i.data.thumb) ? t.setData({
                        thumb: !1
                    }) : t.setData({
                        thumb: i.data.thumb
                    }), a._isTextEmpty(i.data.description) ? t.setData({
                        description: !1
                    }) : t.setData({
                        description: i.data.description
                    }), "order" !== t.data.params ? (wx.setNavigationBarTitle({
                        title: i.data.title
                    }), t.setData({
                        status: i.data.status,
                        loading: !0
                    })) : t.setData({
                        status: 0,
                        loading: !0
                    }), 1 === t.data.status) {
                        t.setData({
                            diyform: i.data,
                            thumb: i.data.thumb
                        });
                        var d = t.data.diyform.fields;
                        for (var s in d) {
                            var o = {
                                title: d[s].tp_name,
                                value: d[s].value,
                                data_type: d[s].data_type,
                                tp_must: d[s].tp_must
                            };
                            "3" == o.data_type && (o.value = d[s].value.join(",")), "7" == o.data_type && (o.value = d[s].value), 
                            "1" == o.data_type && (o.value = d[s].value), t.data.formList.push(o), t.setData({
                                formList: t.data.formList
                            });
                        }
                    } else {
                        t.setData({
                            diyform: i.data
                        });
                        var n = t.data.diyform.fields, r = t.data.diydata, c = null;
                        for (var u in n) {
                            if (7 == n[u].data_type) {
                                var l = Date.parse(new Date()), p = new Date(l), y = p.getFullYear(), h = p.getMonth() + 1 < 10 ? "0" + (p.getMonth() + 1) : p.getMonth() + 1, m = p.getDate() < 10 ? "0" + p.getDate() : p.getDate();
                                console.log(y + "-" + h + "-" + m);
                                var f = y + "-" + h + "-" + m;
                                c = {
                                    name: u,
                                    data: n[u],
                                    value: n[u].default_time,
                                    type: t.data.types[n[u].data_type]
                                };
                            }
                            if ("diycheckbox" == t.data.types[n[u].data_type]) c = {
                                name: u,
                                data: n[u],
                                value: n[u].value ? n[u].value : [],
                                type: t.data.types[n[u].data_type]
                            }; else if ("diydate" == t.data.types[n[u].data_type]) c = {
                                name: u,
                                data: n[u],
                                value: n[u].value ? n[u].value : "",
                                type: t.data.types[n[u].data_type],
                                timeShow: !1,
                                currentDate: new Date().getTime(),
                                shoTime: n[u].default_time ? n[u].default_time : f
                            }; else if ("diyselect" == t.data.types[n[u].data_type]) {
                                for (var v = [], g = 0; g < n[u].tp_text.length; g++) v.push({
                                    name: n[u].tp_text[g]
                                });
                                c = {
                                    name: u,
                                    data: n[u],
                                    value: n[u].value ? n[u].value : "",
                                    type: t.data.types[n[u].data_type],
                                    diysishow: !1,
                                    sitem: v
                                };
                            } else c = "diycity" == t.data.types[n[u].data_type] ? {
                                name: u,
                                data: n[u],
                                value: n[u].value ? n[u].value : "",
                                type: t.data.types[n[u].data_type],
                                showAdd: !1
                            } : "diyimage" == t.data.types[n[u].data_type] ? {
                                name: u,
                                data: n[u],
                                imgUrls: n[u].value ? n[u].value : [],
                                isPhoto: !1,
                                type: t.data.types[n[u].data_type]
                            } : {
                                name: u,
                                data: n[u],
                                value: n[u].value ? n[u].value : "",
                                type: t.data.types[n[u].data_type]
                            };
                            r.push(c), t.setData({
                                diydata: r
                            });
                        }
                        t.addSelectedState();
                    }
                },
                fail: function(t) {
                    console.log(t);
                }
            })) : this.flightGroup();
        },
        tpnameinp: function(a) {
            var e = a.detail.value, i = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + i + "].value", e));
        },
        flightGroup: function() {
            if (this.setData({
                status: this.data.datas.status
            }), 1 === this.data.status) {
                this.setData({
                    diyform: this.data.datas
                });
                var t = this.data.diyform.fields;
                for (var a in t) {
                    var e = {
                        title: t[a].tp_name,
                        value: t[a].value,
                        data_type: t[a].data_type,
                        tp_must: t[a].tp_must
                    };
                    "3" == e.data_type && (e.value = t[a].value.join(",")), "7" == e.data_type && (e.value = t[a].value), 
                    "1" == e.data_type && (e.value = t[a].value), this.data.formList.push(e), this.setData({
                        formList: this.data.formList
                    });
                }
            } else {
                this.setData({
                    diyform: this.data.datas
                });
                var i = this.data.diyform.fields, d = this.data.diydata, s = null;
                for (var o in i) {
                    if (7 == i[o].data_type) {
                        var n = Date.parse(new Date()), r = new Date(n), c = r.getFullYear(), u = r.getMonth() + 1 < 10 ? "0" + (r.getMonth() + 1) : r.getMonth() + 1, l = r.getDate() < 10 ? "0" + r.getDate() : r.getDate();
                        console.log(c + "-" + u + "-" + l);
                        var p = c + "-" + u + "-" + l;
                        s = {
                            name: o,
                            data: i[o],
                            value: i[o].default_time,
                            type: this.data.types[i[o].data_type]
                        };
                    }
                    if ("diycheckbox" == this.data.types[i[o].data_type]) s = {
                        name: o,
                        data: i[o],
                        value: i[o].value ? i[o].value : [],
                        type: this.data.types[i[o].data_type]
                    }; else if ("diydate" == this.data.types[i[o].data_type]) s = {
                        name: o,
                        data: i[o],
                        value: i[o].value ? i[o].value : "",
                        type: this.data.types[i[o].data_type],
                        timeShow: !1,
                        currentDate: new Date().getTime(),
                        shoTime: i[o].default_time ? i[o].default_time : p
                    }; else if ("diyselect" == this.data.types[i[o].data_type]) {
                        for (var y = [], h = 0; h < i[o].tp_text.length; h++) y.push({
                            name: i[o].tp_text[h]
                        });
                        s = {
                            name: o,
                            data: i[o],
                            value: i[o].value ? i[o].value : "",
                            type: this.data.types[i[o].data_type],
                            diysishow: !1,
                            sitem: y
                        };
                    } else s = "diycity" == this.data.types[i[o].data_type] ? {
                        name: o,
                        data: i[o],
                        value: i[o].value ? i[o].value : "",
                        type: this.data.types[i[o].data_type],
                        showAdd: !1
                    } : "diyimage" == this.data.types[i[o].data_type] ? {
                        name: o,
                        data: i[o],
                        imgUrls: i[o].value ? i[o].value : [],
                        isPhoto: !1,
                        type: this.data.types[i[o].data_type]
                    } : {
                        name: o,
                        data: i[o],
                        value: i[o].value ? i[o].value : "",
                        type: this.data.types[i[o].data_type]
                    };
                    d.push(s), this.setData({
                        diydata: d
                    });
                }
            }
        },
        update: function() {
            var t = [], e = {};
            if (this.data.diydata.forEach(function(t) {
                if ("diyimg" == t.type) {
                    for (var a = [], i = 0; i < t[t.name + "Value1"].length; i++) a.push(t[t.name + "Value1"][i].url);
                    e[t.name] = a;
                } else e[t.name] = t.value;
            }), !a._isTextEmpty(this.data.form_data_id)) var i = {
                form_data: t,
                form_data_id: this.data.form_data_id
            };
            t.push(e), console.log(i);
        },
        onRead_1: function(t) {
            try {
                var e = this.data.diydata, i = t.currentTarget.dataset.idex;
                if (e[i].imgUrls.length >= e[i].data.tp_max) return void wx.showToast({
                    title: "最多只能上传".concat(e[i].data.tp_max, "张"),
                    icon: "none",
                    duration: 1e3
                });
            } catch (t) {
                console.log(t);
            }
            var d = t.currentTarget.dataset.name;
            this.setData({
                setname: d
            });
            var s = this, o = a.getNetAddresss(this.data.uploadUrl);
            wx.chooseImage({
                count: 1,
                sizeType: [ "original", "compressed" ],
                sourceType: [ "album", "camera" ],
                success: function(t) {
                    var a = t.tempFilePaths;
                    wx.compressImage({
                        src: a[0],
                        quality: 60,
                        success: function(t) {
                            t.tempFilePath;
                            wx.uploadFile({
                                url: o,
                                filePath: a[0],
                                name: "file",
                                formData: {
                                    attach: s.data.setname
                                },
                                success: function(t) {
                                    var a = JSON.parse(t.data);
                                    if (1 == a.result) {
                                        for (var e = s.data.diydata, i = 0; i < e.length; i++) e[i].name == a.data.attach && e[i].imgUrls.push(a.data.img_url);
                                        s.setData({
                                            diydata: e
                                        });
                                    } else wx.showToast({
                                        icon: "none",
                                        title: a.msg,
                                        duration: 1500
                                    });
                                }
                            });
                        },
                        fail: function(t) {
                            console.log(t);
                        },
                        complete: function(t) {}
                    });
                }
            });
        },
        removeImg: function(t) {
            var a = t.currentTarget.dataset.indexc, e = t.currentTarget.dataset.index, i = this.data.diydata;
            i[e].imgUrls.splice(a, 1), this.setData({
                diydata: i
            });
        },
        diytextareainp: function(a) {
            var e = a.detail, i = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + i + "].value.value.value", e));
        },
        checkboxinp: function(a) {
            var e = a.detail, i = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + i + "].value", e));
        },
        diyselectBtn: function(a) {
            var e = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + e + "].diysishow", !0));
        },
        raidinp: function(a) {
            var e = a.detail, i = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + i + "].value", e));
        },
        showAddBtn: function(a) {
            var e = a.currentTarget.dataset.idex, i = Number(a.currentTarget.dataset.col);
            this.setData(t({
                cityselect_columns: 0 == i ? 2 : 3
            }, "diydata[" + e + "].showAdd", !0));
        },
        _closeDateLw: function(a) {
            var e = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + e + "].showAdd", !1));
        },
        _initAddressInfo: function() {
            var t = this;
            wx.getStorage({
                key: "provinceData",
                success: function(a) {
                    console.log("地址信息准备就绪"), t._getProvinceData();
                },
                fail: function(e) {
                    a._getNetWork({
                        url: a.getNetAddresss("member.member-address.address"),
                        success: function(a) {
                            var e = a.data, i = e.data.province, d = e.data.city, s = e.data.district;
                            wx.setStorage({
                                key: "provinceData",
                                data: i
                            }), wx.setStorage({
                                key: "cityData",
                                data: d
                            }), wx.setStorage({
                                key: "districtData",
                                data: s
                            }), t._initAddressInfo();
                        },
                        fail: function(t) {},
                        state: !0
                    });
                }
            });
        },
        _getProvinceData: function() {
            var t = this;
            wx.getStorage({
                key: "provinceData",
                success: function(a) {
                    t.setData({
                        provinceData: a.data
                    }), t.setData({
                        "selectAddressData[0].name": a.data[t.data.pickerValue[0]].areaname,
                        "selectAddressData[0].id": a.data[t.data.pickerValue[0]].id,
                        "selectAddressData[0].index": t.data.pickerValue[0]
                    }), t._getCityData();
                }
            });
        },
        _getCityData: function() {
            var t = this.data.selectAddressData[0], a = this;
            wx.getStorage({
                key: "cityData",
                success: function(e) {
                    for (var i = [], d = 0; d < e.data.length; d++) e.data[d].parentid == t.id && i.push(e.data[d]);
                    a.setData({
                        cityData: i
                    }), a.setData({
                        "selectAddressData[1].name": i[a.data.pickerValue[1]].areaname,
                        "selectAddressData[1].id": i[a.data.pickerValue[1]].id,
                        "selectAddressData[1].index": a.data.pickerValue[1]
                    }), a._getDistrictData();
                }
            });
        },
        _getDistrictData: function() {
            var t = this.data.selectAddressData[1], a = this;
            wx.getStorage({
                key: "districtData",
                success: function(e) {
                    for (var i = [], d = 0; d < e.data.length; d++) e.data[d].parentid == t.id && i.push(e.data[d]);
                    a.setData({
                        districtData: i
                    }), a.setData({
                        "selectAddressData[2].name": i[a.data.pickerValue[2]].areaname,
                        "selectAddressData[2].id": i[a.data.pickerValue[2]].id,
                        "selectAddressData[2].index": a.data.pickerValue[2]
                    });
                }
            });
        },
        bindChange: function(t) {
            var a = t.detail.value;
            this.data.pickerValue[0] != a[0] && (a[1] = 0, a[2] = 0), this.data.pickerValue[1] != a[1] && (a[2] = 0), 
            this.setData({
                "pickerValue[0]": a[0],
                "pickerValue[1]": a[1],
                "pickerValue[2]": a[2]
            }), this._initAddressInfo();
        },
        resultAdd: function(a) {
            var e, i = a.currentTarget.dataset.idex, d = this.data.selectAddressData, s = d[0].name + " " + d[1].name;
            3 == this.data.cityselect_columns && (s = s + " " + d[2].name), this.setData((t(e = {}, "diydata[" + i + "].value", s), 
            t(e, "diydata[" + i + "].showAdd", !1), e));
        },
        openPicker: function(a) {
            var e = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + e + "].timeShow", !0));
        },
        _closeDateLw_1: function() {
            this.setData({
                showCity1: !1
            });
        },
        resultAdd_1: function() {
            var t = this.data.selectAddressData, a = t[0].name + " " + t[1].name;
            3 == this.data.cityselect_columns && (a = a + " " + t[2].name), this.setData({
                "applyModel.province_name": t[0].name,
                "applyModel.city_name": t[1].name,
                "applyModel.district_name": 3 == this.data.cityselect_columns ? t[2].name : "",
                fullAddress: a,
                showCity1: !1
            });
        },
        submit: function() {
            var t = this;
            wx.showLoading({
                title: ""
            }), setTimeout(function() {
                return wx.hideLoading(), t.validation(), !!t.data.isValidation && (t.submitForm(), 
                !0);
            }, 1e3);
        },
        validation: function() {
            var t = this;
            this.setData({
                isValidation: !0
            }), this.data.diydata.forEach(function(a) {
                1 != a.data.tp_must || a.value || "diyimage" == a.type || "diydate" == a.type || "diyselect" == a.type || (wx.showToast({
                    icon: "none",
                    title: a.data.tp_name + "必须填写哦",
                    duration: 1500
                }), t.setData({
                    isValidation: !1
                })), 1 != a.data.tp_must || "diyimage" != a.type || a.shoTime || a.imgUrls.length <= 0 && (wx.showToast({
                    icon: "none",
                    title: "必须上传".concat(a.data.tp_name),
                    duration: 1500
                }), t.setData({
                    isValidation: !1
                })), 1 != a.data.tp_must || a.shoTime || "diydate" != a.type || (wx.showToast({
                    icon: "none",
                    title: a.data.tp_name + "必须填写哦",
                    duration: 1500
                }), t.setData({
                    isValidation: !1
                })), 1 == a.data.tp_must && "" == t.data.pullDown && "diyselect" == a.type && (wx.showToast({
                    icon: "none",
                    title: a.data.tp_name + "必须填写哦",
                    duration: 1500
                }), t.setData({
                    isValidation: !1
                })), "diycheckbox" == a.type && 0 == a.value.length && 1 == a.data.tp_must && (wx.showToast({
                    icon: "none",
                    title: a.data.tp_name + "必须选择哦",
                    duration: 1500
                }), t.setData({
                    isValidation: !1
                }));
            });
        },
        submitForm: function() {
            if (!this.data.click) {
                var t = this;
                t.setData({
                    click: !0
                }), setTimeout(function() {
                    t.setData({
                        click: !1
                    });
                }, 5e3);
                var e = [], i = {};
                if (this.data.diydata.forEach(function(e) {
                    if ("diyimage" == e.type ? i[e.name] = e.imgUrls : i[e.name] = e.value, "diytextarea" == e.type) try {
                        i[e.name] = e.value.value.value;
                    } catch (t) {
                        console.log(t);
                    }
                    "diydate" == e.type && (i[e.name] = a._isTextEmpty(e.value) ? e.shoTime : t.timestampToTime(1e3 * e.value));
                }), e.push(i), "flight" != this.data.params && "returnData" != this.data.params && "activity" != this.data.modeType) {
                    var d = {}, s = "";
                    "member" == t.data.modeType ? (s = a.getNetAddresss("plugin.diyform.api.diy-form.save-form-data"), 
                    d = {
                        form_id: this.data.datas,
                        form_data: e
                    }) : (s = a.getNetAddresss("plugin.diyform.api.diy-form.save-diy-form-data"), d = {
                        form_id: this.data.datas.form_id,
                        form_data: e
                    }), a._postNetWork({
                        url: s,
                        showToastIn: !1,
                        data: d,
                        success: function(e) {
                            var i = e.data;
                            if (1 == i.result) {
                                if (wx.showToast({
                                    icon: "success",
                                    title: "提交成功",
                                    duration: 1500
                                }), "coupon" == t.data.aisTag) return void wx.navigateTo({
                                    url: "/packageD/coupon/coupon_store"
                                });
                                if (t.data.activity && !a._isTextEmpty(t.data.activity.goodsId)) return void wx.navigateTo({
                                    url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&&goodsId=" + t.data.activity.goodsId + "&&optionsId=" + t.data.activity.optionsId + "&&total=" + t.data.activity.total + "&store_id=" + t.data.store_id
                                });
                                "order" !== t.data.params ? t.getForm() : t.triggerEvent("traCheckedData", {
                                    diyform_data_id: i.data.form_data_id,
                                    pre_id: t.data.datas.pre_id
                                });
                            } else wx.showToast({
                                icon: "none",
                                title: i.msg,
                                duration: 1500
                            });
                        },
                        fail: function(t) {}
                    });
                } else this.triggerEvent("gofunarr", e);
            }
        },
        is_sub: function() {
            a._isTextEmpty(this.data.activity.goodsId) || wx.navigateTo({
                url: "/packageD/buy/myOrder_v2/myOrder_v2?tag=-2&&goodsId=" + this.data.activity.goodsId + "&&optionsId=" + this.data.activity.optionsId + "&&total=" + this.data.activity.total
            });
        },
        showCity1btn: function() {
            this.setData({
                showCity1: !0
            });
        },
        toshaky: function() {
            1 == this.data.payStatus && wx.showToast({
                title: "活动已报名,需要去我的报名进行付款",
                icon: "none",
                duration: 1e3,
                success: function() {
                    setTimeout(function() {
                        wx.navigateTo({
                            url: "/packageC/Myshaky/Myshaky/Myshaky"
                        });
                    }, 1100);
                }
            });
        },
        sitemSelectBtn: function(a) {
            var e, i = a.detail.name, d = a.currentTarget.dataset.index;
            this.setData((t(e = {}, "diydata[" + d + "].value", i), t(e, "diydata[" + d + "].diysishow", !1), 
            e));
        },
        sitemClose: function(a) {
            var e = a.currentTarget.dataset.index;
            this.setData(t({}, "diydata[" + e + "].diysishow", !1));
        },
        dateClose: function(a) {
            var e = a.currentTarget.dataset.idex;
            this.setData(t({}, "diydata[" + e + "].timeShow", !1));
        },
        timestampToTime: function(t) {
            var a = new Date(t);
            return a.getFullYear() + "-" + ((a.getMonth() + 1 < 10 ? "0" + (a.getMonth() + 1) : a.getMonth() + 1) + "-") + (this.change(a.getDate()) + " ");
        },
        change: function(t) {
            return t < 10 ? "0" + t : t;
        },
        birthdayconfirm: function(a, e) {
            var i, d = a.currentTarget.dataset.idex, s = a.detail;
            this.setData((t(i = {}, "diydata[" + d + "].value", String(s).substring(0, 10)), 
            t(i, "diydata[" + d + "].shoTime", this.timestampToTime(s)), t(i, "diydata[" + d + "].timeShow", !1), 
            i));
        }
    }
});